package android.storefront.common.utils.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper {

	private static final int defaultVersion = 1;
	
	public DatabaseHelper(Context context, String databaseName, SQLiteDatabase.CursorFactory cursorFactory, int version){
		super(context, databaseName, cursorFactory, version);
	}
	
	public DatabaseHelper(Context context, String databaseName, int version){
		super(context, databaseName, null, version);
	}
	
	public DatabaseHelper(Context context, String databaseName){
		super(context, databaseName, null, defaultVersion);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		//第一次使用时创建数据库所需要的多有表
		db.execSQL("create table dual(id int)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		//更新数据库版本
	}

}
